﻿<%
IF not(Session("logKEY")="_root"  or Session("logKEY")="_administrator" ) THEN
response.redirect "noAcRight.asp"
response.end
END IF
'无高级管理员权限者无法访问此页【未写】

%>
<!--#include file=../../include/config.asp -->
<!--#include file=../../include/conn3.asp -->
<!--#include file=../../include/md5.asp -->

<title><%=sitename%>添加用户</title>
<%
set rs=server.CreateObject ("Adodb.RecordSet")
rs.Source="select * from admin where username='" & request("username")& "'"
rs.Open rs.Source,conn,1,1
if not( rs.EOF  or rs.bof) then
%>
<script language=javascript>
alert("该用户已经存在！");history.go(-1);
</script>
<%
else
password=replace(trim(request("passwordset")),"'","")
	if strLength(password)>16 or strLength(password)<6 then
	response.write  "<script language=javascript>alert('请输入的密码位数不能小于6位或大于16位!');history.go(-1);</script>"
	response.End
	end if
set rsnew=server.CreateObject("ADODB.RecordSet")	
rsnew.open "select * from admin",conn,3,2
rsnew.addnew
rsnew("usertypeID")=replace(trim(request("select")),"'","")
rsnew("username")=request("username")
rsnew("password")=md5(password)
rsnew.update
rsnew.close
rs.close
set rs=nothing
set rsnew=nothing
call CloseConn()
response.redirect "usermodpan.asp"
end if%>